<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- slot标签中间可以加内容，这个内容会作为插槽的默认值 -->
    <div id="app">
      <h2>具名插槽</h2>
      <child>
        <!-- <span>🍉</span>
        <span>🍇</span> -->

        <template v-slot:left>
          <span>🍉</span>
        </template>
        <template #right>
          <span>🍇</span>
        </template>
      </child>

      <!-- <van-grid>
        <van-grid-item text="文字">
          <template #icon>
            <img src="" alt="">
          </template>
        </van-grid-item>
        <van-grid-item icon="photo-o" text="文字" />
        <van-grid-item icon="photo-o" text="文字" />
        <van-grid-item icon="photo-o" text="文字" />
      </van-grid> -->
    </div>

    <script src="./vue.js"></script>
    <script>
      const Child = {
        // template: `
        //   <div>这是child子组件 - <slot>999</slot></div>
        // `,
        template: `
          <div><slot name="left"></slot> - 这是child子组件 - <slot name="right"></slot></div>
        `,
      };

      Vue.createApp({
        data() {
          return {};
        },
        components: {
          Child,
        },
      }).mount("#app");
    </script>
  </body>
</html>
